##将粒子按ｉｄ排序
import os
import numpy as np
files = os.listdir('.')
for ff in files:
    if '.txt' in ff and 'rank' not in ff:
        data = np.loadtxt(ff)
        data.sort(axis = 0)
        os.remove(ff)
        np.savetxt(ff, data)
    print ff, "sorted"
print "sorting over"
